package com.woniuxy.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.woniuxy.entity.ClientRecharge;

import com.woniuxy.service.ClientRechargeService;
import com.woniuxy.utils.Result;

@Controller
@RequestMapping("/clientrecharge")
public class ClientRechargeController {
	@Autowired
	private ClientRechargeService clientRechargeService;
	@RequestMapping("/all")
	@ResponseBody
	public Result<List<ClientRecharge>> all(){
		Result<List<ClientRecharge>> result = new Result<>();
		 result.setData(clientRechargeService.all());
		return result;
	}
	@RequestMapping("/update")
	@ResponseBody
	public Result<List<ClientRecharge>> updateClientRecharge(ClientRecharge clientRecharge){
		Result<List<ClientRecharge>> result = new Result<>();
		if(clientRechargeService.updateClientRecharge(clientRecharge)==1){
			result.setStatus(Result.SUCCESS);
			result.setMessage("成功");
		}else{
			result.setStatus(Result.ERROR);
			result.setMessage("no");
		}
		return result;
		
	}
	
}
